/**
 * 2018年5月3日下午10:21:26
 */
package com.an.nopro.app.framework.controller;

import java.util.Random;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.an.nopro.app.framework.entity.Person;
import com.an.nopro.app.framework.redis.respository.PersonRedisDao;

/**
 * 
 * @目的：测试Angular.<br>
 * 
 * @author 86171
 * @date 2018年5月3日下午10:21:26
 * 
 */
@RestController
public class AngularController {

	@Autowired
	private PersonRedisDao personRedisDao;

	@RequestMapping(value = "/search", produces = { MediaType.APPLICATION_JSON_UTF8_VALUE })
	public Person search(String personName) {
		Person person = new Person(personName, new Random().nextInt(120), "杭州");
		person.setId(new Random().nextLong());
		personRedisDao.save(person);
		System.err.println(personRedisDao.getPerson(person.getId()));
		return person;
	}

}
